import config from '@/config';
import RequestBase from '@/utils/request.js';

const baseRequest = new RequestBase(config.equipment);

// 维护事项待执行列表
export function itemWaitExecute(data) {
  return baseRequest.get('/mobile/dfm/maintenance/task/my-todo-task', data);
}

// 维护事项待执行列表详情
export function executeDetail(id, type) {
  return baseRequest.get(`/mobile/dfm/maintenance/task/my-todo-task/detail/${id}/${type}`);
}

// 维护事项待确认列表
export function itemWaitConfirm(data) {
  return baseRequest.get('/mobile/dfm/maintenance/task/my-todo-confirm', data);
}

// 维护事项待确认列表详情
export function confirmDetail(id) {
  return baseRequest.get(`/mobile/dfm/maintenance/task/my-todo-confirm/detail/${id}`);
}

// 维护保养
export function maintenanceExecute(data) {
  return baseRequest.post('/mobile/dfm/maintenance/task/execute', data);
}

// 确认
export function maintenanceConfirm(data) {
  return baseRequest.post('/mobile/dfm/maintenance/task/confirm', data);
}

// 保养记录
export function maintenanceRecord(id) {
  return baseRequest.get(`/mobile/dfm/maintenance/task/task-item-execute/${id}`);
}

//获取维保标准
export function getMaintenanceStandard(params) {
  return baseRequest.get(`/dfm/maintenance/standard/device/${params}`)
}

//获取维保记录
export function getMaintenanceRecord(params) {
  return baseRequest.get(`/dfm/maintenance/task/getDeviceRecordList`, params)
}